﻿<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <link rel="shortcut icon" type="image/x-icon" href="/img/favicon.ico" />

    <link rel="stylesheet" type="text/css" href="/css/jquery.dataTables.min.css">
    <link rel="stylesheet" type="text/css" href="/css/buttons.dataTables.min.css">
    <!-- <link rel="stylesheet" type="text/css" href="/css/nav.css"> -->
    <!-- <link rel="stylesheet" type="text/css" href="/css/dataTables.bootstrap.css"> -->
    

<!-- bootstrap -->
    <!-- <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/dataTables.bootstrap4.min.css">
   	 -->
    <style type="text/css">
        body {
            font-size: 12px;
            padding:20px;
        }
        form{
        }
        form table{
        	width: 100%;
        	margin-bottom:30px;
        }
        form label{
        	font-size:17px;
        }
        form input[type=text]{
			margin-bottom: 10px;  
        	font-size:17px;      	
        }
        form input[type=submit]{
			float: right;   
			padding: 10px 20px; 	
        }
        form input[type=button]{
			float: right;   
			padding: 10px 20px; 	
        }
    </style>
</head>
<script lang="javascrit">

</script>
<body>
	
	<form  method="get">
	<table>
	<tr><td><div class="header_mid">
		<div class="w1200 clearfix">
			<div class="logo">
				<a href="?app_act=page/index" target="_blank"><img src="http://www.baison.com.cn/custom/ishop/web/theme/default/pc//images/logo.png?1519990325"></a>
			</div>
		</div>
	</div></td></tr><tr><td width='100%'>
	<div style="margin-right:10px;margin-bottom:0px;float:right;"><input name='submit' id='submit' type='button' value="查询"/>
	<div style="margin-right:10px;float:right;"><label for='starDate'>起始日期：</label><input id='starDate' type='text' name="starDate" value=""/><br />
	  <label for='endDate'>结束日期：</label><input id='endDate' type='text' name="endDate" value=""/>
	</div>
	</div>
	</td></tr></table>
	
	</form>

<table id="example" class="display cell-border nowrap" cellspacing="0" width="100%">
    <thead>
        <tr>
            <th>WMS流水号</th>
            <th>ERP单号</th>
            <th>ERP原单号</th>
            <th>WMS数量</th>
            <th>ERP数量</th>
            <th>日期</th>
        </tr>
    </thead>
    <tfoot>
        <tr>
            <th>WMS流水号</th>
            <th>ERP单号</th>
            <th>ERP原单号</th>
            <th>WMS数量</th>
            <th>ERP数量</th>
            <th>日期</th>
        </tr>
    </tfoot>
</table>
</body>
<script src="/js/jquery-3.2.1.min.js"></script>
<script src="/js/jquery.dataTables.js"></script>
<script src="/js/fnReloadAjax.js"></script>  
<!-- <script src="/js/buttons.flash.min.js"></script> -->
<script src="/js/dataTables.buttons.min.js"></script>
<script src="/js/jszip.min.js"></script>
<!-- <script src="/js/pdfmake.min.js"></script> -->
<!-- <script src="/js/vfs_fonts.js"></script> -->
<script src="/js/buttons.html5.min.js"></script>
<!-- <script src="/js/buttons.print.min.js"></script> -->
<!-- <script src="/js/dataTables.bootstrap.js"></script> -->
<!-- <script src="https://cdn.datatables.net/1.10.16/js/dataTables.bootstrap4.min.js"></script> -->
    
<script type="text/javascript">
	function subform()
	{
		table.fnReloadAjax();
	}
	$(document).ready(function() {
		
	    $('#submit').click( function () {
	    	starDate=$("#starDate").val(),  
		    endDate=$("#endDate").val()
	        table.fnReloadAjax('/data/sql?starDate='+starDate+'&endDate='+endDate);
	    } );
	    var table = $('#example').dataTable( {
	        "ajax": {
	        	url:"/data/sql",
		        cache: false
	        },
	        "deferRender": true,
	        "lengthMenu":[ 20, 25, 100, 75, 10],
	        "columns": [
	            { "data": "BillId" },
	            { "data": "DJBH" },
	            { "data": "YDJH" },
	            { "data": "QTYIN" },
	            { "data": "SL" },
	            { "data": "CDate" }
	        ],
	        dom: 'Bfrtip',
	        buttons: [
	            'copy', 'excel'
	        ]
	    } );
	    
	    $('#example tbody').on( 'click', 'button', function () {
	        var data = table.row( $(this).parents('tr') ).data();
	        alert( data[0] +"'s salary is: "+ data[ 5 ] );
	    } );
	} );
</script>
</html>
